package com.example.take_out_file.controll;

import com.example.take_out_file.common.Result;
import com.example.take_out_file.service.FileService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description:none
 * @Author:yyyyys、
 * @Date:2024/7/4 1:27
 * @Version:1.0
 **/

@Slf4j
@RestController
@RequestMapping("/file")
public class FileController {
    @Resource
    private FileService fileService;

    @PostMapping("upload")
    public Result<Object> upload(MultipartFile File){
        return Result.success(fileService.upload(File));
    }
}
